<template>
  <el-table-column :prop="prop" :label="label" :header-align="headerAlign" :align="align" :width="width" :min-width="minWidth" :class-name="className">
    <template #default="scope">
      <ma-dict-label :dict-type="props.dictType" :dict-value="scope.row[props.prop]" />
    </template>
  </el-table-column>
</template>

<script setup lang="ts" name="MaDictColumn">
import MaDictLabel from '@/components/ma-dict/ma-dict-label/index.vue'
const props = defineProps({
  prop: {
    type: String,
    required: true
  },
  label: {
    type: String,
    required: true
  },
  dictType: {
    type: String,
    required: true
  },
  headerAlign: {
    type: String,
    required: false,
    default: () => 'center'
  },
  align: {
    type: String,
    required: false,
    default: () => 'center'
  },
  width: {
    type: String,
    required: false,
    default: () => ''
  },
  minWidth: {
    type: String,
    required: false,
    default: () => ''
  },
  className: {
    type: String,
    required: false,
    default: () => ''
  }
})
</script>
